package com.example.starter.work3

import io.vertx.core.AbstractVerticle
import io.vertx.core.Promise
import io.vertx.core.eventbus.DeliveryOptions
import io.vertx.core.eventbus.Message


/**
@author whd
@date 2023/10/10 15:23:29
 */
class ClientVerticle: AbstractVerticle() {
  override fun start() {
    vertx.setPeriodic(5000) {
      val url = "https://www.sn180.com/company/sellbuycate.html"
        vertx.eventBus().request<String>("url", url) { response ->
          if (response.succeeded()) {
            println("内容: ${response.result().body()}")
          } else {
            println("请求失败: ${response.cause().message}")
          }
        }
    }
  }

  override fun stop() {
    super.stop()
  }
}
